<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title></title>
		<link href="./public/css/bootstrap.min_1.css" rel="stylesheet" type="text/css"/>
		<link rel="stylesheet" href="./public/css/header.css"  type="text/css"/>
		<link rel="stylesheet" href="./public/css/select.css"  type="text/css"/>
		<link rel="stylesheet" type="text/css" href="./public/css/bootstrap-datetimepicker.min.css"/>
		<link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.2/style/weui.min.css">
		<link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css">
		<style type="text/css">
			th{
				margin-bottom: 10px;
				margin-left: 10px;
				    padding: 10px;
				    text-align: center;
			}
			table{
				margin: 0px auto;
			}
			td{
				  
				    text-align: center;
			}
		</style>
	</head>
	<body>
		<!--<div class="container">-->
			<!-- 头部 start -->
			<div class="header">
				<a href="{:U('Index/index')}" class="home">主页</a>
				<div class="title">
					订单查询
				</div>
			</div>
			<!-- 头部 -->
			<div class="content">
				<div class="input">
					<label class="control-label " >目标</label> <input id="user_list" type="text" class="input-sm" style="width:86px;"/>
				    <!-- <div class="controls"> 
				    	<label class="control-label " >用户</label>
						<select name="price" class="input-large" id="user_list">
							<option value="0">全部</option>
							<option value="100"></option>
						</select>
      				</div> -->
				</div>
				<div class = "time">
					<label class="control-label" >开始时间</label>
					<input type="date" class="datePicker" id="start_time"  value=""/>
				</div>
				<div class="time">
					<label class="control-label " >结束时间</label>
					<input type="date" class="datePicker" id="end_time" value=""/>
				</div>
				<div class="footer">
					<div id="product"  class="controls" style="margin-left: 12.5%;"> 
				    	<label class="control-label " >产品</label>
						<select id="price" name="price" class="input-large">
							<option value="0">积分支付</option>
						</select>
      				</div>
      				
      				<div class="controls"> 
				    	<label class="control-label " >状态</label>
						<select id="status" name="price" class="input-large">
							<option value="1">成功</option>
							<option value="0">失败</option>
						</select>
      				</div>
				</div>
				<div class="sub_btn">
						<button type="button" class="btn  btn-success" id="select_btn">查询</button>
						<button type="button" class="btn  btn-success">导出结果</button>
				</div>
			</div>
			
				<table id="table" style="display: none">
				 <tr>
                <th>序号</th>
                <th>用户名</th>
              	<th>积分</th>
              	<th>金额</th>
                <th>生成时间</th>
                <th>状态</th>
            

               
            </tr>

           
             <tr class="tr">
                  
                 
                    
               
                </tr>
          
			</table>

		
			

		<!--</div>-->
		<script type="text/javascript" src="./public/js/jquery-2.1.0.js"></script>
		<script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
        <script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js"></script>
		<script>
			$(function(){

				$("#select_btn").click(function(){
					// alert(111)
					var start_time = $('#start_time').val();//开始时间
					var end_time = $('#end_time').val();//结束时间
					var user_list = $('#user_list').val(); //用户选择
					var status = $("#status").val();//状态
					$.post(
						"{:U('Select/select')}",
						{start_time:start_time,end_time:end_time,user:user_list,status:status},
						function(res){
							if(res.code==10000){
								alert(res.msg);
								$('#table').css('display','block');
								html='';
								for (var i = 0;i<res.data.length;i++) {
										html+='<td>'+res.data[i].id+'</td>';
										html+='<td>'+res.data[i].phone+'</td>';
										html+=' <td>'+res.data[i].score+'</td>';
										html+=' <td>'+res.data[i].money+'</td>';
										html+=' <td>'+res.data[i].add_time+'</td>';
										html+='<td>'+res.data[i].status+'</td>';
										$('.tr').html(html);
								}
								
                    
                
                   
                   
							}else{
								$('#table').css('display','none');
								alert(res.msg);
							}
						}

						)
				})

			})
		</script>
	</body>
</html>
